import request from '@/utils/request'

// 查询设备保养计划列表
export function listCare(query) {
  return request({
    url: '/mes/care/list',
    method: 'get',
    params: query
  })
}

// 查询设备保养计划详细
export function getCare(id) {
  return request({
    url: '/mes/care/' + id,
    method: 'get'
  })
}

// 新增设备保养计划
export function addCare(data) {
  return request({
    url: '/mes/care',
    method: 'post',
    data: data
  })
}
// 修改设备保养计划
export function updateCare(data) {
  return request({
    url: '/mes/care',
    method: 'put',
    data: data
  })
}
// 删除设备保养计划
export function delCare(id) {
  return request({
    url: '/mes/care/' + id,
    method: 'delete'
  })
}
//添加保养记录
export function addDetail(data) {
    return request({
      url: '/mes/care/addDetail',
      method: 'post',
      data: data
    })
  }
  // 客户信息状态修改
export function changeMesCareStatus(id, status,code,ctype) {
    const data = {
      id,
      status,
      code,ctype
    };
    return request({
      url: "/mes/care/changeStatus",
      method: "put",
      data: data,
    });
  }